<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#tab-base" data-toggle="tab">{:__('基本设置')}</a></li>
        <li><a href="#tab-custom" data-toggle="tab">{:__('设置样式')}</a></li>
    </ul>
    <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST">
        <input type="hidden" name="row[scenario]" value="edit" />
        <div class="tab-content">
            <div class="tab-pane active" id="tab-base">
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-name" class="form-control" type="text" name="row[name]" title="" value="{$row.name|htmlentities}" data-rule="required">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('开始时间')}:</label>
                    <div class="col-xs-12 col-sm-3">
                        <input id="c-start_time" class="form-control datetimepicker" type="text" name="row[start_time]" title="" value="{:$row.start_time ? datetime($row.start_time) : ''}" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" data-rule="required">
                    </div>
                    <label class="control-label col-xs-12 col-sm-2">{:__('结束时间')}:</label>
                    <div class="col-xs-12 col-sm-3">
                        <input id="c-end_time" class="form-control datetimepicker" type="text" name="row[end_time]" title="" value="{:$row.end_time ? datetime($row.end_time) : ''}" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" data-rule="required">
                    </div>
                </div>
                <div class="form-group">
                    <label for="c-activity_img" class="control-label col-xs-12 col-sm-2">{:__('活动图片')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-activity_img" class="form-control" size="50" name="row[activity_img]" value="{$row.activity_img}" type="text">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-activity_img" class="btn btn-danger faupload" data-input-id="c-activity_img" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-activity_img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-activity_img" class="btn btn-primary fachoose" data-input-id="c-activity_img" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                                <span><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="left" data-trigger="hover" title="活动图片与活动详情二选一，活动图片优先展示，效果更好"><i class="fa fa-question-circle text-gray"></i></button></span>
                            </div>
                            <span class="msg-box n-right" for="c-activity_img"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-activity_img"></ul>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('活动详情')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <textarea id="c-activity_rich" class="form-control editor" name="row[activity_rich]" title="" style="min-height: 500px">{$row.activity_rich|htmlentities}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-note" class="form-control" type="text" name="row[note]" value="{$row.note|htmlentities}" title="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('限定分组')}:</label>
                    <div class="col-xs-12 col-sm-8 group-tree">
                        <input type="hidden" name="row[group_ids]">
                        <span class="text-muted"><input type="checkbox" name="" id="checkAll" /> <label for="checkAll"><span>{:__('Check all')}</span></label></span>
                        <span class="text-muted"><input type="checkbox" name="" id="expandAll" /> <label for="expandAll"><span>{:__('Expand all')}</span></label></span>
                        <div id="treeView"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('权重')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-weight" class="form-control" type="number" name="row[weight]" value="{$row.weight|htmlentities}" title="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        {:build_radios('row[status]', $statusList, $row['status'])}
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="tab-custom">
                <div class="form-group">
                    <label for="c-login_top_img" class="control-label col-xs-12 col-sm-2">{:__('登录页图片')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-login_top_img" data-rule="required" class="form-control" size="50" name="row[login_top_img]" value="{$row.login_top_img}" type="text">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-login_top_img" class="btn btn-danger faupload" data-input-id="c-login_top_img" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-login_top_img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-login_top_img" class="btn btn-primary fachoose" data-input-id="c-login_top_img" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-login_top_img"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-login_top_img"></ul>
                    </div>
                </div>
                <div class="form-group">
                    <label for="c-home_top_img" class="control-label col-xs-12 col-sm-2">{:__('首页图片')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-home_top_img" data-rule="required" class="form-control" size="50" name="row[home_top_img]" value="{$row.home_top_img}" type="text">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-home_top_img" class="btn btn-danger faupload" data-input-id="c-home_top_img" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-home_top_img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-home_top_img" class="btn btn-primary fachoose" data-input-id="c-home_top_img" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-home_top_img"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-home_top_img"></ul>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('支持的登录方式')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="checkbox">
                            {foreach name="loginMethods" item="vo"}
                            <label for="row[login_methods][]-{$key}"><input id="row[login_methods][]-{$key}" type="checkbox" name="row[login_methods][]" value="{$key}" data-tip="{$vo.tip}" {in name="key" value="$row.login_methods" }checked{/in}> {$vo.name}</label>
                            {/foreach}
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('登录页底部备注')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-login_note" class="form-control" type="text" name="row[login_note]" value="{$row.login_note|htmlentities}" title="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('登陆页兑换提示')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <textarea id="c-tips" class="form-control" name="row[tips]" title="" placeholder="弹窗提示" style="min-height: 120px">{$row.tips|htmlentities}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label for="c-login_top_img" class="control-label col-xs-12 col-sm-2">{:__('活动封面图')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-cover_url" class="form-control" type="text" name="row[cover_url]" value="{$row.cover_url}" title="">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-cover_url" class="btn btn-danger faupload" data-input-id="c-cover_url" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-cover_url"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-cover_url" class="btn btn-primary fachoose" data-input-id="c-cover_url" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-cover_url"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-cover_url"></ul>
                    </div>
                </div>
                <div class="form-group">
                    <label for="c-login_top_img" class="control-label col-xs-12 col-sm-2">{:__('活动开屏页')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-welcome_img" class="form-control" type="text" name="row[welcome_img]" value="{$row.welcome_img}" title="">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-welcome_img" class="btn btn-danger faupload" data-input-id="c-welcome_img" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-welcome_img"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-welcome_img" class="btn btn-primary fachoose" data-input-id="c-welcome_img" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-welcome_img"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-welcome_img"></ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group layer-footer">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
                <button class="btn btn-success btn-embossed disabled" type="submit">{:__('OK')}</button>
                <button class="btn btn-default btn-embossed" type="reset">{:__('Reset')}</button>
            </div>
        </div>
    </form>
</div>

<style>
    .wrap {
        margin-top: 30px;
        display: flex;
    }
    .wrap .nav-tabs {
        width: 100px;
        margin-left: 50px;
        border-bottom: none;
    }
    .wrap .form-horizontal {
        flex: 1;
    }

    .nav-tabs > li > a, .nav-tabs > li > a:hover, .nav-tabs > li > a:focus {
        width: 100px;
        text-align: center;
        line-height: 2;
        border: 1px solid #ddd;
        background: #eee;
        color: #555555;
    }

    .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
        border: 1px solid #ddd !important;
        font-weight: bold;
    }

    /* 分组树 */
    .group-tree {
        margin-top: 8px;
    }
    .group-tree .jstree-themeicon {
        display: none !important;
    }
    .group-tree .text-muted {
        margin-right: 10px;
    }
    .group-tree #treeView {
        margin-top: 5px;
    }
</style>